import type { RouteRecordRaw } from 'vue-router';
import { ADMIN_URL, LOGIN_URL } from '@/constant';

/**
 * 定义默认路由
 */
export const defaultRoutes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: LOGIN_URL,
    },
    {
        path: '/login',
        name: 'login',
        component: () => import('@/views/login/index.vue'),
        meta: {
            title: '登陆',
            auth: false,
        },
    },
    {
        path: '/admin',
        name: 'admin',
        component: () => import('@/layouts/index.vue'),
        redirect: ADMIN_URL,
        children: [
            {
                path: '/admin/dashboard',
                name: 'admin-dashboard',
                component: () => import('@/views/admin/dashboard/index.vue'),
                meta: {
                    title: '仪表盘',
                    auth: true,
                    menu: '1000',
                },
            },
            {
                path: '/admin/live',
                name: 'admin-live',
                component: () => import('@/views/admin/live/index.vue'),
                meta: {
                    title: '分屏监控',
                    auth: true,
                    menu: '1001',
                },
            },
            {
                path: '/admin/device',
                name: 'admin-device',
                component: () => import('@/views/admin/device/index.vue'),
                meta: {
                    title: '国标设备',
                    auth: true,
                    menu: '1002',
                },
            },
            {
                path: '/admin/device/:device_id/channel-list',
                name: 'admin-device-channel-list',
                component: () => import('@/views/admin/devicechannel/index.vue'),
                meta: {
                    title: '国标设备通道列表',
                    auth: true,
                    menu: '1002',
                },
            },
            {
                path: '/admin/stream/push',
                name: 'admin-stream-push',
                component: () => import('@/views/admin/streampush/index.vue'),
                meta: {
                    title: '推流列表',
                    auth: true,
                    menu: '1003',
                },
            },
            {
                path: '/admin/stream/proxy',
                name: 'admin-stream-proxy',
                component: () => import('@/views/admin/streamproxy/index.vue'),
                meta: {
                    title: '拉流代理',
                    auth: true,
                    menu: '1004',
                },
            },
            {
                path: '/admin/virtual/video/stream',
                name: 'admin-virtual-video-stream',
                component: () => import('@/views/admin/virtualvideostream/index.vue'),
                meta: {
                    title: '模拟视频流',
                    auth: true,
                    menu: '1005',
                },
            },
            {
                path: '/admin/platform',
                name: 'admin-platform',
                component: () => import('@/views/admin/platform/index.vue'),
                meta: {
                    title: '国标级联平台',
                    auth: true,
                    menu: '1006',
                },
            },
            {
                path: '/admin/user',
                name: 'admin-user',
                component: () => import('@/views/admin/user/index.vue'),
                meta: {
                    title: '用户管理',
                    auth: true,
                    menu: '1007',
                },
            },
        ],
    },
];
